package com.karaoke.android.kege.adapter

import android.databinding.ViewDataBinding
import com.karaoke.android.data.LoadMoreEvent
import com.karaoke.android.library.databind.BindingListViewAdapter
import org.simple.eventbus.EventBus

/**
 * Created by allen on 2017/4/25.
 */
class SingerGridAdapter<T> : BindingListViewAdapter<T>(1)
{
    override fun onBindBinding(binding: ViewDataBinding?, variableId: Int, layoutRes: Int, position: Int, item: T)
    {
        super.onBindBinding(binding, variableId, layoutRes, position, item)
        if (count - position <= 1)
        {
            EventBus.getDefault().post(LoadMoreEvent())
        }
    }
}